//
//  BSCoreLocation.h
//  BASE_LIB
//
//  Created by shiji on 2018/3/13.
//  Copyright © 2018年 shiji. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

//extern const CLLocationAccuracy kCLLocationAccuracyBest;
//extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
//extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
//extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
//extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;

typedef NS_ENUM(NSInteger, LocationAccuracy) {
    LocationAccuracyUnKnown             = -1,
    LocationAccuracyBestForNavigation   = 0,
    LocationAccuracyBest                = 1,
    LocationAccuracyNearestTenMeters    = 2,
    LocationAccuracyHundredMeters       = 3,
    LocationAccuracyKilometer           = 4,
    LocationAccuracyThreeKilometers     = 5,
};

typedef NS_OPTIONS(NSInteger, LocService) {
    LocServiceLocationService      = 1<<0,
    LocServiceHeadingAvailable     = 1<<1,
    LocServiceRegionMonitoringAvailable = 1<<2
};

typedef double LOC_DOUBLE ;

typedef  void (^LocationUpdateBlock) (CLLocation *obj);;
typedef  void (^HeadingUpdateBlock) (CLHeading *obj);;

@interface BSCoreLocation : NSObject
+ (instancetype)shared;

@property (nonatomic, assign) LocService locService;

@property (nonatomic, assign) LocationAccuracy locAccuracy;

@property (nonatomic, assign) LOC_DOUBLE disFilter;

@property (nonatomic, strong, readonly) CLLocation *currentLocations;

@property (nonatomic, strong, readonly) CLLocation *lastLocations;

- (void)start;
- (void)start:(LocationUpdateBlock)block;
- (void)start:(LocationAccuracy)accuracy block:(LocationUpdateBlock)block;
- (void)start:(LocationAccuracy)accuracy
distanceFilter:(LOC_DOUBLE)distanceFilter
        block:(LocationUpdateBlock)block;

- (void)start:(LocationAccuracy)accuracy
distanceFilter:(LOC_DOUBLE)distanceFilter
   locService:(LocService)locService
     locBlock:(LocationUpdateBlock)locBlock
 headingBlock:(HeadingUpdateBlock)headingBlock;

- (void)stop;
@end
